let huiwenshu=function(...arg){
    let aa=[...arg]
    let bb=arg.reverse()
    console.log(aa.filter((item,index)=>item===bb[index]).length==arg.length?true:false)

    //刚开始反转不会
    let arr=arg.filter((item,index)=>{
        return arg[arg.length-1-index]===item
    })
    console.log(arr)
    if(arr.length===arg.length){ 
        return true
    }else{
        return false
    }
}
console.log(huiwenshu(1,3,3,3,1))
let much=function(arr){
    let num=[];
    let ind=0;
    arr.forEach((item,index)=>{
        num[index]=arr.filter(item1=>item1===item).length;
        num[index]>num[ind]?ind=index:ind
    })
    console.log(Math.max.apply(null,num),num,ind)
    if(Math.max.apply(null,num)>arr.length/2){ 
        return arr[ind]
    }else{
        return -1
    }
}
console.log(much([2,2,2,2,2,2,52,21,4,42,32,1,2,2,2]))